<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>02事件修饰符</title>
  <script src="../js/vue.js"></script>
</head>
<body>
  <!-- 
    常用的事件修饰符
      prevent
      stop
      capture
      self
      once
      passive
   -->
  <div id="app">
    <h1>{{title}}</h1>
    <a href="https://www.baidu.com/" @click="handleClick">百度一下</a>
    <a href="https://www.baidu.com/" @click.prevent="handleClick2">click</a>
  </div>
  <script>
    new Vue({
      el: '#app',
      data() {
        return {
          title: '事件修饰符'
        }
      },
      methods: {
        handleClick(e) {
          alert('hello world')
          e.preventDefault();
        },
        handleClick2() {
          alert('hello world')
        }
      }
    })
  </script>
</body>
</html>